package com.t235.gc.zuul.controller;

import com.t235.gc.AjaxResult;
import com.t235.gc.feign.goods.GoodsRemoteClient;
import com.t235.gc.vo.GoodsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
public class GoodsFallBackController {
    @Autowired
    private GoodsRemoteClient goodsRemoteClient;

    @RequestMapping("/goods/admin/getBackGoodsList")
    public AjaxResult getBackDeviceCabinetList(GoodsVo goodsVo, Integer page ,Integer limit){
        AjaxResult ajaxResult=goodsRemoteClient.getBackDeviceCabinetList(goodsVo, page, limit);
        if (!"success".equals(ajaxResult.getMsg())&&!"error".equals(ajaxResult.getMsg())){
            return AjaxResult.error(ajaxResult.getMsg());
        }
        return ajaxResult;
    }
}
